package hotel

import (
	"APT/internal/model/input/input_hotel"
	"github.com/gogf/gf/v2/frame/g"
)

type OrderListReq struct {
	g.Meta      `path:"/home/OrderList" method:"post" tags:"APP_HOTEL" summary:"酒店订单_订单列表"`
	PageNum     int    `p:"pageNum" v:"required#页码未知" dc:"页码"`
	PageSize    int    `p:"pageSize" v:"required#页数未知" dc:"页数"`
	OrderStatus string `p:"orderStatus" v:"in:WAIT_PAY,HAVE_PAID,CANCEL#订单状态格式错误" dc:"订单状态【WAIT_PAY、待支付 HAVE_PAID、已支付 CANCEL、已取消】"`
}

type OrderListRes struct {
	List  []*OrderItem
	Count int `json:"count"`
}

type OrderItem struct {
	Id              int     `json:"id" dc:"订单ID"`
	PropertyName    string  `json:"propertyName" dc:"物业名称"`
	Address         string  `jsonn:"address" dc:"地址"`
	ExpirationTime  int     `json:"expiration_time" dc:"订单过期时间"`
	OrderStatus     string  `json:"orderStatus" dc:"订单状态___WAIT_PAY、待支付 HAVE_PAID、已支付 CANCEL、已取消"`
	OrderAmount     float64 `json:"order_amount" dc:"订单金额"`
	OrderSn         string  `json:"orderSn" dc:"订单号"`
	RoomNum         int     `json:"roomNum" dc:"房间数量"`
	CheckInDate     string  `json:"checkInDate" dc:"入住时间"`
	CheckOutDate    string  `json:"checkOutDate" dc:"退房时间"`
	Days            int     `json:"days" dc:"入住市场按天计算"`
	AdultCount      float64 `json:"adult_count" dc:"成人数量"`
	ChildCount      float64 `json:"child_count" dc:"儿童数量"`
	CreateOrderTime string  `json:"createTime" dc:"创建时间"`
	Countdown       int     `json:"countdown" dc:"订单支付倒计时秒"`
	RefundStatus    string  `json:"refundStatus" dc:"退款状态"`
	ThirePayAmount  float64 `json:"thirePayAmount" dc:"第三方支付金额"`
}

type OrderDetailReq struct {
	g.Meta  `path:"/home/OrderDetail" method:"post" tags:"APP_HOTEL" summary:"酒店订单_订单详情"`
	OrderSn string `json:"orderSn" dc:"订单号"`
}

type OrderDetailRes struct {
	Id              int    `json:"id" dc:"订单id"`
	OrderSn         string `json:"orderSn" dc:"订单号"`
	CreateOrderTime string `json:"createOrderTime" dc:"创建订单时间"`
	Countdown       int    `json:"countdown" dc:"订单支付倒计时秒"`
	CheckinStatus   string `json:"checkinStatus" dc:"入住状态 "`
	Property        struct {
		Cover        string `json:"cover"            dc:"封面"`
		Name         string `json:"name"             dc:"物业名称"`
		Address      string `json:"address"          dc:"地址描述"`
		RequiredBook string `json:"requiredBook"     dc:"订房必读"`
	}
	OrderDate struct {
		StartDate string `json:"startDate" dc:"入住日期"`
		EndDate   string `json:"endDate"   dc:"退房日期"`
		Days      int    `json:"days"      dc:"总天数"`
	}
	User struct {
		FullName  string `json:"fullName"      dc:"全名"`
		Phone     string `json:"phone"         dc:"手机号"`
		PhoneArea string `json:"phoneArea"     dc:"手机区号"`
		Mail      string `json:"mail"          dc:"邮箱"`
	}
	MemberId  int `json:"memberId" dc:"会员ID"`
	RatePlans []*input_hotel.OrderRooms
	PayInfo   struct {
		PayModel     int     `json:"payModel"      dc:"支付方式-1纯余额支付-2余额加外部支付-3纯外部支付"`
		AllAmount    float64 `json:"allAmount"     dc:"订单总金额"`
		OrderStatus  string  `json:"orderStatus" dc:"订单支付状态 WAIT_PAY-待支付  HAVE_PAID-已支付  CANCEL-取消支付"`
		RefundStatus string  `json:"refundStatus" dc:"退款状态 WAIT 等待退款、DONE 完成退款、PART 部分退款"`
		Balance      struct {
			BalanceAmount     float64 `json:"amount" dc:"余额支付金额"`
			BalancePayOrderSn string  `json:"payOrderSn" dc:"余额支付订单号"`
			PayStatus         string  `json:"payStatus" dc:"支付状态 WAIT 等待支付、DONE 完成支付、CANCEL 取消支付"`
			RefundStatus      string  `json:"refundStatus" dc:"退款状态 WAIT 等待退款、DONE 完成退款、CANCEL 取消退款"`
			RefundAmount      float64 `json:"refundAmount" dc:"退款金额"`
		}
		ThirdPay struct {
			ThirdAmount     float64 `json:"amount" dc:"外部支付金额"`
			ThirdPayOrderSn string  `json:"payOrderSn" dc:"外部支付订单号"`
			PayStatus       string  `json:"payStatus" dc:"支付状态 WAIT 等待支付、DONE 完成支付、CANCEL 取消支付"`
			RefundStatus    string  `json:"refundStatus" dc:"退款状态 WAIT 等待退款、DONE 完成退款、CANCEL 取消退款"`
			RefundAmount    float64 `json:"refundAmount" dc:"退款金额"`
		}
		Coupon struct {
			CouponAmount     float64 `json:"amount" dc:"优惠券支付金额"`
			CouponPayOrderSn string  `json:"payOrderSn" dc:"优惠券支付订单号"`
			PayStatus        string  `json:"payStatus" dc:"支付状态 WAIT 等待支付、DONE 完成支付、CANCEL 取消支付"`
			RefundStatus     string  `json:"refundStatus" dc:"退款状态 WAIT 等待退款、DONE 完成退款、CANCEL 取消退款"`
			RefundAmount     float64 `json:"refundAmount" dc:"退款金额"`
		}
	}
	PayAmount    float64                        `json:"payAmount" dc:"支付金额"`
	RefundDetail *input_hotel.RefundDetailModel `json:"refundDetail" dc:"订单退款详情"`
}
